
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class REPAIR_TYPEMap : EntityTypeConfiguration<REPAIR_TYPE>
    {
        public REPAIR_TYPEMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.TITLE)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.REMARK).HasMaxLength(500);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.MODIFY_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("REPAIR_TYPE");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.TITLE).HasColumnName("TITLE");
            this.Property(t => t.FROM).HasColumnName("FROM");
            this.Property(t => t.TO).HasColumnName("TO");
            this.Property(t => t.UNIT).HasColumnName("UNIT");
            this.Property(t => t.CHARGED).HasColumnName("CHARGED");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.MODIFY_BY).HasColumnName("MODIFY_BY");
            this.Property(t => t.MODIFY_DATE).HasColumnName("MODIFY_DATE");
        }
    }
}
